﻿@page "/admin/settings/subscription"
@section scripts{
    <script type="module">
        import * as settings from '/js/app/admin.settings.module.js';

        const form = document.querySelector('#form-settings');
        form.addEventListener('submit', settings.handleSettingsSubmit);
    </script>
}
@{
    var settings = BlogConfig.FeedSettings;
}

@section admintoolbar{
    <partial name="_SettingsHeader" />
}

<form id="form-settings" asp-controller="Settings" asp-action="Subscription" spellcheck="false">
    <div class="admin-settings-entry-container">
        <div class="row">
            <div class="col-lg-6">
                <div class="settings-entry row align-items-center py-3 px-2 rounded-3 shadow-sm border mb-2">
                    <div class="col-auto">
                        <i class="bi-list-ol settings-entry-icon"></i>
                    </div>
                    <div class="col">
                        <label asp-for="@settings.FeedItemCount"></label>
                        <div class="form-text">@SharedLocalizer["The number of entries to include in RSS/ATOM feed."]</div>
                    </div>
                    <div class="col-md-5">
                        <input asp-for="@settings.FeedItemCount" class="form-control" required />
                    </div>
                </div>

                <div class="settings-entry row align-items-center py-3 px-2 rounded-3 shadow-sm border">
                    <div class="col-auto">
                        <i class="bi-justify-left settings-entry-icon"></i>
                    </div>
                    <div class="col">
                        <label asp-for="@settings.UseFullContent" class="form-check-label"></label>
                    </div>
                    <div class="col-md-5 text-end">
                        <div class="form-check form-switch form-control-lg">
                            <input type="hidden" name="UseFullContent" value="false">
                            <input type="checkbox" name="UseFullContent" value="true" class="form-check-input" @(@settings.UseFullContent ? "checked" : null) />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="admin-settings-action-container border-top pt-2 mt-2">
        <input id="btn-save-settings" type="submit" value="@SharedLocalizer["Save"]" class="btn btn-outline-accent" />
    </div>
</form>
